import { uniFetch } from './uni-fetch'

/**
 *  用户登录
 *  @param {Object} data 用户账号和用户密码
 */
export const login = (data) => {
  if (!data.account || !data.password) return
  return uniFetch.post('/driver/login/account', data)
}

/**
 * 个人资料
 */
export const profile = () => {
  return uniFetch.get('/driver/users')
}

/**
 * 个人中心任务数据
 */
export const task = (year, month) => {
  return uniFetch.get('/driver/users/taskReport', { year, month })
}

/**
 * 车辆信息
 */
export const truck = () => {
  return uniFetch.get('/driver/users/truck')
}
